package com.admin.domain.modle;

import java.io.Serializable;
import java.util.UUID;

/**
 * description 订单座位关系表 User: WeiDa Date: 2017-4-11 Time: 17:24
 */
public class OrderSeat implements Serializable {

    /**
     * 唯一资源编码
     */
    private String id = UUID.randomUUID().toString();

    /**
     * 名称
     */
    private String name;

    /**
     * 座位ID
     */
    private Integer seatId;

    /**
     * 订单ID
     */
    private Integer orderId;

    /**
     * 楼层
     */
    private Integer floor;
    private double price;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSeatId() {
        return seatId;
    }

    public void setSeatId(Integer seatId) {
        this.seatId = seatId;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public Integer getFloor() {
        return floor;
    }

    public void setFloor(Integer floor) {
        this.floor = floor;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getFormatDesc() {
        // 1层100元区2排18号*1张（含茶）；
        return String.format("%s层%s元区%s；", Integer.toString(floor), Double.toString(price), name);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        OrderSeat resource = (OrderSeat) o;

        return id != null ? id.equals(resource.id) : resource.id == null;

    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }
}
